import React, { useEffect } from 'react'
import { Pagination } from 'antd';
import { useTitle, usePage } from '../hooks'
import { useLocation, useNavigate, Routes, Route } from 'react-router-dom'
// useNavigate 路由跳转的hook

export default function About7(props) {
    const [pageList, total] = usePage("https://api-hmugo-web.itheima.net/api/public/v1/goods/search", {
        cid: 9,
        pagenum: 1,
        pagesize: 5
    })
    const history = useNavigate()

    return (
        <div>
            <ul>
                {
                    pageList.map(item => {
                        return <li key={ item.goods_id }>
                            { item.goods_name }
                        </li>
                    })
                }
            </ul>
            <button onClick={() => {
                history("/about")
            }}>点我跳转</button>
            <Pagination defaultCurrent={1} total={total} />
            <Routes>
                <Route path="/home/one" element={<div>11111111</div>}></Route>
            </Routes>
        </div>
    )
}
